Skip to content

fix: ga 'api request rest' command @W-23493730@ - #194

Merged
WillieRuemmele merged 4 commits into
mainfrom
wr/gaRequestRest
Aug 10, 2026
Merged

fix: ga 'api request rest' command @W-23493730@#194
WillieRuemmele merged 4 commits into
mainfrom
wr/gaRequestRest

Conversation

@WillieRuemmele

Copy link
Copy Markdown
Contributor

What does this PR do?

GA's api request rest command

What issues does this PR fix or reference?

@W-23493730@

@WillieRuemmele
WillieRuemmele requested a review from a team August 3, 2026 19:17

@k80bowman k80bowman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks fine, just one recommendation.

Comment thread src/shared/shared.ts
Comment on lines +26 to +45
export function redactError(error: unknown): unknown {
if (error instanceof Error && 'options' in error) {
const opts = error as Error & { options?: { headers?: Record<string, unknown> } };
if (opts.options?.headers) {
for (const key of Object.keys(opts.options.headers)) {
if (key.toLowerCase() === 'authorization') {
opts.options.headers[key] = '[REDACTED]';
}
}
}
}
return error;
}

export type ApiResponseResult = {
statusCode: number;
headers: Record<string, string | string[]>;
body: AnyJson | string;
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like it would be better to move this to SfError instead of having it live only in this plugin. That way we can easily redact authorization headers from all error messages, instead of only error messages from this plugin.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per discussion, we are good to keep this here for now.

@WillieRuemmele
WillieRuemmele merged commit 7d91085 into main Aug 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants